﻿namespace HRM.CORE.REPORT
{
    using DevExpress.Utils;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraReports.UI;
    using Dictionary.ERP;
    using HRM.CORE;
    using HRM.CORE.CLASS;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;

    public class rptTimekeeperTableStyle1Theme2 : XtraReport
    {
        private BottomMarginBand BottomMargin;
        private XRTableCell colCompensationDay;
        private XRTableCell colD1;
        private XRTableCell colD10;
        private XRTableCell colD11;
        private XRTableCell colD12;
        private XRTableCell colD13;
        private XRTableCell colD14;
        private XRTableCell colD15;
        private XRTableCell colD16;
        private XRTableCell colD17;
        private XRTableCell colD18;
        private XRTableCell colD19;
        private XRTableCell colD2;
        private XRTableCell colD20;
        private XRTableCell colD21;
        private XRTableCell colD22;
        private XRTableCell colD23;
        private XRTableCell colD24;
        private XRTableCell colD25;
        private XRTableCell colD26;
        private XRTableCell colD27;
        private XRTableCell colD28;
        private XRTableCell colD29;
        private XRTableCell colD3;
        private XRTableCell colD30;
        private XRTableCell colD31;
        private XRTableCell colD4;
        private XRTableCell colD5;
        private XRTableCell colD6;
        private XRTableCell colD7;
        private XRTableCell colD8;
        private XRTableCell colD9;
        private XRTableCell colEmployeeCode;
        private XRTableCell colEmployeeName;
        private XRTableCell colFurloughDay;
        private XRTableCell colNightDutyDay;
        private Color colorD1;
        private Color colorD10;
        private Color colorD11;
        private Color colorD12;
        private Color colorD13;
        private Color colorD14;
        private Color colorD15;
        private Color colorD16;
        private Color colorD17;
        private Color colorD18;
        private Color colorD19;
        private Color colorD2;
        private Color colorD20;
        private Color colorD21;
        private Color colorD22;
        private Color colorD23;
        private Color colorD24;
        private Color colorD25;
        private Color colorD26;
        private Color colorD27;
        private Color colorD28;
        private Color colorD29;
        private Color colorD3;
        private Color colorD30;
        private Color colorD31;
        private Color colorD4;
        private Color colorD5;
        private Color colorD6;
        private Color colorD7;
        private Color colorD8;
        private Color colorD9;
        private XRTableCell colOrder;
        private XRTableCell colRealDay;
        private XRTableCell colRegulationDay;
        private XRTableCell colShiftName;
        private XRTableCell colWorkTotal;
        private IContainer components;
        private DetailBand Detail;
        private GroupHeaderBand GroupHeader1;
        private HRM_EMPLOYEE l_Employee;
        private HRM_TIMEKEEPER_TABLE l_TimeKeeper;
        private HRM_TIMEKEEPER_TABLELIST l_TimeKeeperTableList;
        private string m_Code;
        private int m_Level;
        private int m_Month;
        private float m_TopF;
        private int m_Year;
        private XRPictureBox ptPhoto;
        private ReportFooterBand ReportFooter;
        private ReportHeaderBand ReportHeader;
        private TopMarginBand TopMargin;
        private XRLabel txtAddress;
        private XRLabel txtCompany;
        private XRLabel txtTitle;
        private XRLabel txtUnit;
        private XRLabel xrLabel1;
        private XRLabel xrLabel2;
        private XRLabel xrLabel25;
        private XRTable xrTable1;
        private XRTableRow xrTableRow1;

        public rptTimekeeperTableStyle1Theme2()
        {
            this.l_TimeKeeper = new HRM_TIMEKEEPER_TABLE();
            this.l_TimeKeeperTableList = new HRM_TIMEKEEPER_TABLELIST();
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.m_TopF = 0f;
            this.colorD1 = Color.White;
            this.colorD2 = Color.White;
            this.colorD3 = Color.White;
            this.colorD4 = Color.White;
            this.colorD5 = Color.White;
            this.colorD6 = Color.White;
            this.colorD7 = Color.White;
            this.colorD8 = Color.White;
            this.colorD9 = Color.White;
            this.colorD10 = Color.White;
            this.colorD11 = Color.White;
            this.colorD12 = Color.White;
            this.colorD13 = Color.White;
            this.colorD14 = Color.White;
            this.colorD15 = Color.White;
            this.colorD16 = Color.White;
            this.colorD17 = Color.White;
            this.colorD18 = Color.White;
            this.colorD19 = Color.White;
            this.colorD20 = Color.White;
            this.colorD21 = Color.White;
            this.colorD22 = Color.White;
            this.colorD23 = Color.White;
            this.colorD24 = Color.White;
            this.colorD25 = Color.White;
            this.colorD26 = Color.White;
            this.colorD27 = Color.White;
            this.colorD28 = Color.White;
            this.colorD29 = Color.White;
            this.colorD30 = Color.White;
            this.colorD31 = Color.White;
            this.components = null;
            this.InitializeComponent();
        }

        public rptTimekeeperTableStyle1Theme2(int Level, string Code, int Month, int Year)
        {
            this.l_TimeKeeper = new HRM_TIMEKEEPER_TABLE();
            this.l_TimeKeeperTableList = new HRM_TIMEKEEPER_TABLELIST();
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.m_TopF = 0f;
            this.colorD1 = Color.White;
            this.colorD2 = Color.White;
            this.colorD3 = Color.White;
            this.colorD4 = Color.White;
            this.colorD5 = Color.White;
            this.colorD6 = Color.White;
            this.colorD7 = Color.White;
            this.colorD8 = Color.White;
            this.colorD9 = Color.White;
            this.colorD10 = Color.White;
            this.colorD11 = Color.White;
            this.colorD12 = Color.White;
            this.colorD13 = Color.White;
            this.colorD14 = Color.White;
            this.colorD15 = Color.White;
            this.colorD16 = Color.White;
            this.colorD17 = Color.White;
            this.colorD18 = Color.White;
            this.colorD19 = Color.White;
            this.colorD20 = Color.White;
            this.colorD21 = Color.White;
            this.colorD22 = Color.White;
            this.colorD23 = Color.White;
            this.colorD24 = Color.White;
            this.colorD25 = Color.White;
            this.colorD26 = Color.White;
            this.colorD27 = Color.White;
            this.colorD28 = Color.White;
            this.colorD29 = Color.White;
            this.colorD30 = Color.White;
            this.colorD31 = Color.White;
            this.components = null;
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
            this.m_Month = Month;
            this.m_Year = Year;
        }

        private void Create(DataTable dt)
        {
            int num = DateTime.DaysInMonth(this.m_Year, this.m_Month);
            XRTable child = new XRTable();
            XRTable table2 = new XRTable();
            XRLabel label = new XRLabel();
            string str = "";
            int num2 = 0;
            int num3 = 1;
            foreach (DataRow row in dt.Rows)
            {
                string str2 = row["EmployeeCode"].ToString();
                if ((str2 != str) && (num2 != 0))
                {
                    child = new XRTable();
                    table2 = new XRTable();
                    label = new XRLabel();
                }
                XRTableRow row2 = new XRTableRow();
                XRTableCell cell = new XRTableCell();
                XRTableCell cell2 = new XRTableCell();
                XRTableCell cell3 = new XRTableCell();
                XRTableCell cell4 = new XRTableCell();
                XRTableCell cell5 = new XRTableCell();
                XRTableCell cell6 = new XRTableCell();
                XRTableCell cell7 = new XRTableCell();
                XRTableCell cell8 = new XRTableCell();
                XRTableCell cell9 = new XRTableCell();
                XRTableCell cell10 = new XRTableCell();
                XRTableCell cell11 = new XRTableCell();
                XRTableCell cell12 = new XRTableCell();
                XRTableCell cell13 = new XRTableCell();
                XRTableCell cell14 = new XRTableCell();
                XRTableCell cell15 = new XRTableCell();
                XRTableCell cell16 = new XRTableCell();
                XRTableCell cell17 = new XRTableCell();
                XRTableCell cell18 = new XRTableCell();
                XRTableCell cell19 = new XRTableCell();
                XRTableCell cell20 = new XRTableCell();
                XRTableCell cell21 = new XRTableCell();
                XRTableCell cell22 = new XRTableCell();
                XRTableCell cell23 = new XRTableCell();
                XRTableCell cell24 = new XRTableCell();
                XRTableCell cell25 = new XRTableCell();
                XRTableCell cell26 = new XRTableCell();
                XRTableCell cell27 = new XRTableCell();
                XRTableCell cell28 = new XRTableCell();
                XRTableCell cell29 = new XRTableCell();
                XRTableCell cell30 = new XRTableCell();
                XRTableCell cell31 = new XRTableCell();
                XRTableCell cell32 = new XRTableCell();
                cell.Text = row["ShiftCode"].ToString();
                cell2.Text = row["D1"].ToString();
                cell3.Text = row["D2"].ToString();
                cell4.Text = row["D3"].ToString();
                cell5.Text = row["D4"].ToString();
                cell6.Text = row["D5"].ToString();
                cell7.Text = row["D6"].ToString();
                cell8.Text = row["D7"].ToString();
                cell9.Text = row["D8"].ToString();
                cell10.Text = row["D9"].ToString();
                cell11.Text = row["D10"].ToString();
                cell12.Text = row["D11"].ToString();
                cell13.Text = row["D12"].ToString();
                cell14.Text = row["D13"].ToString();
                cell15.Text = row["D14"].ToString();
                cell16.Text = row["D15"].ToString();
                cell17.Text = row["D16"].ToString();
                cell18.Text = row["D17"].ToString();
                cell19.Text = row["D18"].ToString();
                cell20.Text = row["D19"].ToString();
                cell21.Text = row["D20"].ToString();
                cell22.Text = row["D21"].ToString();
                cell23.Text = row["D22"].ToString();
                cell24.Text = row["D23"].ToString();
                cell25.Text = row["D24"].ToString();
                cell26.Text = row["D25"].ToString();
                cell27.Text = row["D26"].ToString();
                cell28.Text = row["D27"].ToString();
                cell29.Text = row["D28"].ToString();
                cell30.Text = row["D29"].ToString();
                cell31.Text = row["D30"].ToString();
                cell32.Text = row["D31"].ToString();
                cell.WidthF = this.colShiftName.WidthF;
                cell2.WidthF = this.colD1.WidthF;
                cell3.WidthF = this.colD2.WidthF;
                cell4.WidthF = this.colD3.WidthF;
                cell5.WidthF = this.colD4.WidthF;
                cell6.WidthF = this.colD5.WidthF;
                cell7.WidthF = this.colD6.WidthF;
                cell8.WidthF = this.colD7.WidthF;
                cell9.WidthF = this.colD8.WidthF;
                cell10.WidthF = this.colD9.WidthF;
                cell11.WidthF = this.colD10.WidthF;
                cell12.WidthF = this.colD11.WidthF;
                cell13.WidthF = this.colD12.WidthF;
                cell14.WidthF = this.colD13.WidthF;
                cell15.WidthF = this.colD14.WidthF;
                cell16.WidthF = this.colD15.WidthF;
                cell17.WidthF = this.colD16.WidthF;
                cell18.WidthF = this.colD17.WidthF;
                cell19.WidthF = this.colD18.WidthF;
                cell20.WidthF = this.colD19.WidthF;
                cell21.WidthF = this.colD20.WidthF;
                cell22.WidthF = this.colD21.WidthF;
                cell23.WidthF = this.colD22.WidthF;
                cell24.WidthF = this.colD23.WidthF;
                cell25.WidthF = this.colD24.WidthF;
                cell26.WidthF = this.colD25.WidthF;
                cell27.WidthF = this.colD26.WidthF;
                cell28.WidthF = this.colD27.WidthF;
                cell29.WidthF = this.colD28.WidthF;
                cell30.WidthF = this.colD29.WidthF;
                cell31.WidthF = this.colD30.WidthF;
                cell32.WidthF = this.colD31.WidthF;
                cell.Padding = new PaddingInfo(4, 0, 0, 0);
                cell2.BackColor = this.colorD1;
                cell3.BackColor = this.colorD2;
                cell4.BackColor = this.colorD3;
                cell5.BackColor = this.colorD4;
                cell6.BackColor = this.colorD5;
                cell7.BackColor = this.colorD6;
                cell8.BackColor = this.colorD7;
                cell9.BackColor = this.colorD8;
                cell10.BackColor = this.colorD9;
                cell11.BackColor = this.colorD10;
                cell12.BackColor = this.colorD11;
                cell13.BackColor = this.colorD12;
                cell14.BackColor = this.colorD13;
                cell15.BackColor = this.colorD14;
                cell16.BackColor = this.colorD15;
                cell17.BackColor = this.colorD16;
                cell18.BackColor = this.colorD17;
                cell19.BackColor = this.colorD18;
                cell20.BackColor = this.colorD19;
                cell21.BackColor = this.colorD20;
                cell22.BackColor = this.colorD21;
                cell23.BackColor = this.colorD22;
                cell24.BackColor = this.colorD23;
                cell25.BackColor = this.colorD24;
                cell26.BackColor = this.colorD25;
                cell27.BackColor = this.colorD26;
                cell28.BackColor = this.colorD27;
                cell29.BackColor = this.colorD28;
                cell30.BackColor = this.colorD29;
                cell31.BackColor = this.colorD30;
                cell32.BackColor = this.colorD31;
                cell.TextAlignment = TextAlignment.MiddleLeft;
                row2.Cells.Add(cell);
                row2.Cells.Add(cell2);
                row2.Cells.Add(cell3);
                row2.Cells.Add(cell4);
                row2.Cells.Add(cell5);
                row2.Cells.Add(cell6);
                row2.Cells.Add(cell7);
                row2.Cells.Add(cell8);
                row2.Cells.Add(cell9);
                row2.Cells.Add(cell10);
                row2.Cells.Add(cell11);
                row2.Cells.Add(cell12);
                row2.Cells.Add(cell13);
                row2.Cells.Add(cell14);
                row2.Cells.Add(cell15);
                row2.Cells.Add(cell16);
                row2.Cells.Add(cell17);
                row2.Cells.Add(cell18);
                row2.Cells.Add(cell19);
                row2.Cells.Add(cell20);
                row2.Cells.Add(cell21);
                row2.Cells.Add(cell22);
                row2.Cells.Add(cell23);
                row2.Cells.Add(cell24);
                row2.Cells.Add(cell25);
                row2.Cells.Add(cell26);
                row2.Cells.Add(cell27);
                row2.Cells.Add(cell28);
                if (num >= 0x1c)
                {
                    row2.Cells.Add(cell29);
                }
                if (num >= 0x1d)
                {
                    row2.Cells.Add(cell30);
                }
                if (num >= 30)
                {
                    row2.Cells.Add(cell31);
                }
                if (num >= 0x1f)
                {
                    row2.Cells.Add(cell32);
                }
                row2.Borders = BorderSide.Bottom | BorderSide.Right | BorderSide.Left;
                child.Rows.Add(row2);
                child.TextAlignment = TextAlignment.MiddleCenter;
                if (str != str2)
                {
                    num3++;
                    child.WidthF = ((((((((this.xrTable1.WidthF - this.colOrder.WidthF) - this.colEmployeeCode.WidthF) - this.colEmployeeName.WidthF) - this.colRealDay.WidthF) - this.colNightDutyDay.WidthF) - this.colRegulationDay.WidthF) - this.colFurloughDay.WidthF) - this.colCompensationDay.WidthF) - this.colWorkTotal.WidthF;
                    XRTableCell cell33 = new XRTableCell();
                    XRTableCell cell34 = new XRTableCell();
                    XRTableCell cell35 = new XRTableCell();
                    XRTableCell cell36 = new XRTableCell();
                    XRTableCell cell37 = new XRTableCell();
                    XRTableCell cell38 = new XRTableCell();
                    XRTableCell cell39 = new XRTableCell();
                    XRTableCell cell40 = new XRTableCell();
                    XRTableCell cell41 = new XRTableCell();
                    cell33.Text = (num3 - 1).ToString();
                    cell34.Text = row["EmployeeCode"].ToString();
                    cell35.Text = row["FirstName"].ToString() + " " + row["LastName"].ToString();
                    cell36.Text = row["RealDay"].ToString();
                    cell37.Text = row["NightDutyDay"].ToString();
                    cell38.Text = row["RegulationDay"].ToString();
                    cell39.Text = row["FurloughDay"].ToString();
                    cell40.Text = row["CompensationDay"].ToString();
                    cell41.Text = row["WorkTotal"].ToString();
                    cell33.WidthF = this.colOrder.WidthF;
                    cell34.WidthF = this.colEmployeeCode.WidthF;
                    cell35.WidthF = this.colEmployeeName.WidthF;
                    cell36.WidthF = this.colRealDay.WidthF;
                    cell37.WidthF = this.colNightDutyDay.WidthF;
                    cell38.WidthF = this.colRegulationDay.WidthF;
                    cell39.WidthF = this.colFurloughDay.WidthF;
                    cell40.WidthF = this.colCompensationDay.WidthF;
                    cell41.WidthF = this.colWorkTotal.WidthF;
                    cell33.TextAlignment = TextAlignment.MiddleCenter;
                    cell34.TextAlignment = TextAlignment.MiddleLeft;
                    cell35.TextAlignment = TextAlignment.MiddleLeft;
                    cell36.Font = new Font("Times New Roman", 8f, FontStyle.Regular);
                    cell37.Font = new Font("Times New Roman", 8f, FontStyle.Regular);
                    cell38.Font = new Font("Times New Roman", 8f, FontStyle.Regular);
                    cell39.Font = new Font("Times New Roman", 8f, FontStyle.Regular);
                    cell40.Font = new Font("Times New Roman", 8f, FontStyle.Regular);
                    cell41.Font = new Font("Times New Roman", 8f, FontStyle.Regular);
                    cell34.Padding = new PaddingInfo(4, 0, 0, 0);
                    cell35.Padding = new PaddingInfo(4, 0, 0, 0);
                    cell33.Borders = cell34.Borders = cell35.Borders = BorderSide.Bottom | BorderSide.Left;
                    cell36.Borders = cell37.Borders = cell38.Borders = cell39.Borders = cell40.Borders = cell41.Borders = BorderSide.Bottom | BorderSide.Right;
                    XRTableRow row3 = new XRTableRow();
                    XRTableCell cell42 = new XRTableCell();
                    row3.Cells.Add(cell33);
                    row3.Cells.Add(cell34);
                    row3.Cells.Add(cell35);
                    cell42.Controls.Add(child);
                    cell42.WidthF = child.WidthF;
                    row3.Cells.Add(cell42);
                    row3.Cells.Add(cell36);
                    row3.Cells.Add(cell37);
                    row3.Cells.Add(cell38);
                    row3.Cells.Add(cell39);
                    row3.Cells.Add(cell40);
                    row3.Cells.Add(cell41);
                    table2.TopF = this.m_TopF;
                    table2.WidthF = this.xrTable1.WidthF;
                    table2.Rows.Add(row3);
                    table2.TextAlignment = TextAlignment.MiddleCenter;
                    table2.Font = new Font("Times New Roman", 7f, FontStyle.Regular);
                    this.Detail.Controls.Add(table2);
                    this.m_TopF += table2.HeightF;
                }
                str = str2;
                num2++;
            }
        }

        private string DayName(int Year, int Month, int Day)
        {
            try
            {
                DateTime time = new DateTime(Year, Month, Day);
                return (Day.ToString() + " " + time.DayOfWeek.ToString().Substring(0, 3));
            }
            catch
            {
                return Day.ToString();
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.Detail = new DetailBand();
            this.TopMargin = new TopMarginBand();
            this.BottomMargin = new BottomMarginBand();
            this.ReportHeader = new ReportHeaderBand();
            this.xrLabel1 = new XRLabel();
            this.xrLabel25 = new XRLabel();
            this.txtTitle = new XRLabel();
            this.txtUnit = new XRLabel();
            this.txtAddress = new XRLabel();
            this.ptPhoto = new XRPictureBox();
            this.txtCompany = new XRLabel();
            this.xrLabel2 = new XRLabel();
            this.GroupHeader1 = new GroupHeaderBand();
            this.xrTable1 = new XRTable();
            this.xrTableRow1 = new XRTableRow();
            this.colOrder = new XRTableCell();
            this.colEmployeeCode = new XRTableCell();
            this.colEmployeeName = new XRTableCell();
            this.colShiftName = new XRTableCell();
            this.colD1 = new XRTableCell();
            this.colD2 = new XRTableCell();
            this.colD3 = new XRTableCell();
            this.colD4 = new XRTableCell();
            this.colD5 = new XRTableCell();
            this.colD6 = new XRTableCell();
            this.colD7 = new XRTableCell();
            this.colD8 = new XRTableCell();
            this.colD9 = new XRTableCell();
            this.colD10 = new XRTableCell();
            this.colD11 = new XRTableCell();
            this.colD12 = new XRTableCell();
            this.colD13 = new XRTableCell();
            this.colD14 = new XRTableCell();
            this.colD15 = new XRTableCell();
            this.colD16 = new XRTableCell();
            this.colD17 = new XRTableCell();
            this.colD18 = new XRTableCell();
            this.colD19 = new XRTableCell();
            this.colD20 = new XRTableCell();
            this.colD21 = new XRTableCell();
            this.colD22 = new XRTableCell();
            this.colD23 = new XRTableCell();
            this.colD24 = new XRTableCell();
            this.colD25 = new XRTableCell();
            this.colD26 = new XRTableCell();
            this.colD27 = new XRTableCell();
            this.colD28 = new XRTableCell();
            this.colD29 = new XRTableCell();
            this.colD30 = new XRTableCell();
            this.colD31 = new XRTableCell();
            this.colRealDay = new XRTableCell();
            this.colNightDutyDay = new XRTableCell();
            this.colRegulationDay = new XRTableCell();
            this.colFurloughDay = new XRTableCell();
            this.colCompensationDay = new XRTableCell();
            this.colWorkTotal = new XRTableCell();
            this.ReportFooter = new ReportFooterBand();
            this.xrTable1.BeginInit();
            this.BeginInit();
            this.Detail.HeightF = 0f;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.Detail.TextAlignment = TextAlignment.TopLeft;
            this.TopMargin.HeightF = 40f;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.TopMargin.TextAlignment = TextAlignment.TopLeft;
            this.BottomMargin.HeightF = 40f;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.BottomMargin.TextAlignment = TextAlignment.TopLeft;
            this.ReportHeader.Controls.AddRange(new XRControl[] { this.xrLabel1, this.xrLabel25, this.txtTitle, this.txtUnit, this.txtAddress, this.ptPhoto, this.txtCompany, this.xrLabel2 });
            this.ReportHeader.HeightF = 125f;
            this.ReportHeader.Name = "ReportHeader";
            this.xrLabel1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrLabel1.LocationFloat = new PointFloat(888.59f, 3.999996f);
            this.xrLabel1.Name = "xrLabel1";
            this.xrLabel1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel1.SizeF = new SizeF(249.4101f, 17.70833f);
            this.xrLabel1.StylePriority.UseFont = false;
            this.xrLabel1.StylePriority.UseTextAlignment = false;
            this.xrLabel1.Text = "Mẩu số: 01a-LĐTL";
            this.xrLabel1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrLabel1.Visible = false;
            this.xrLabel25.LocationFloat = new PointFloat(888.59f, 22.5f);
            this.xrLabel25.Name = "xrLabel25";
            this.xrLabel25.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel25.SizeF = new SizeF(249.4101f, 40.04165f);
            this.xrLabel25.StylePriority.UseTextAlignment = false;
            this.xrLabel25.Text = "(Ban h\x00e0nh theo QĐ số: 48/2006/QĐ-BTC ng\x00e0y 14/09/2006 của Bộ trưởng BTC)";
            this.xrLabel25.TextAlignment = TextAlignment.MiddleCenter;
            this.xrLabel25.Visible = false;
            this.txtTitle.Font = new Font("Times New Roman", 14f, FontStyle.Bold);
            this.txtTitle.LocationFloat = new PointFloat(3.178914E-05f, 68.75f);
            this.txtTitle.Name = "txtTitle";
            this.txtTitle.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtTitle.SizeF = new SizeF(1139f, 30.25001f);
            this.txtTitle.StylePriority.UseFont = false;
            this.txtTitle.StylePriority.UseTextAlignment = false;
            this.txtTitle.Text = "BẢNG CHẤM C\x00d4NG TH\x00c1NG 00/0000";
            this.txtTitle.TextAlignment = TextAlignment.MiddleCenter;
            this.txtUnit.Font = new Font("Times New Roman", 12f);
            this.txtUnit.LocationFloat = new PointFloat(0f, 99.00001f);
            this.txtUnit.Name = "txtUnit";
            this.txtUnit.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtUnit.SizeF = new SizeF(1139f, 17.70834f);
            this.txtUnit.StylePriority.UseFont = false;
            this.txtUnit.StylePriority.UseTextAlignment = false;
            this.txtUnit.TextAlignment = TextAlignment.MiddleCenter;
            this.txtAddress.LocationFloat = new PointFloat(154.3333f, 31.70837f);
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtAddress.SizeF = new SizeF(413.3749f, 17.70833f);
            this.txtAddress.StylePriority.UseTextAlignment = false;
            this.txtAddress.Text = "txtAddress";
            this.txtAddress.TextAlignment = TextAlignment.MiddleLeft;
            this.ptPhoto.LocationFloat = new PointFloat(9.000008f, 3.999996f);
            this.ptPhoto.Name = "ptPhoto";
            this.ptPhoto.SizeF = new SizeF(94.50658f, 58.54166f);
            this.ptPhoto.Sizing = ImageSizeMode.ZoomImage;
            this.txtCompany.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtCompany.LocationFloat = new PointFloat(105.5417f, 10.00001f);
            this.txtCompany.Name = "txtCompany";
            this.txtCompany.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCompany.SizeF = new SizeF(458.1665f, 17.70833f);
            this.txtCompany.StylePriority.UseFont = false;
            this.txtCompany.StylePriority.UseTextAlignment = false;
            this.txtCompany.Text = "txtCompany";
            this.txtCompany.TextAlignment = TextAlignment.MiddleLeft;
            this.xrLabel2.LocationFloat = new PointFloat(105.5417f, 31.70827f);
            this.xrLabel2.Name = "xrLabel2";
            this.xrLabel2.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel2.SizeF = new SizeF(48.7916f, 17.70833f);
            this.xrLabel2.StylePriority.UseTextAlignment = false;
            this.xrLabel2.Text = "Địa chỉ:";
            this.xrLabel2.TextAlignment = TextAlignment.MiddleLeft;
            this.GroupHeader1.Controls.AddRange(new XRControl[] { this.xrTable1 });
            this.GroupHeader1.HeightF = 34.16665f;
            this.GroupHeader1.Name = "GroupHeader1";
            this.GroupHeader1.RepeatEveryPage = true;
            this.xrTable1.AnchorVertical = VerticalAnchorStyles.Bottom;
            this.xrTable1.BackColor = Color.WhiteSmoke;
            this.xrTable1.Borders = BorderSide.All;
            this.xrTable1.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.xrTable1.LocationFloat = new PointFloat(4.768372E-05f, 0f);
            this.xrTable1.Name = "xrTable1";
            this.xrTable1.Rows.AddRange(new XRTableRow[] { this.xrTableRow1 });
            this.xrTable1.SizeF = new SizeF(1139f, 34.16665f);
            this.xrTable1.StylePriority.UseBackColor = false;
            this.xrTable1.StylePriority.UseBorders = false;
            this.xrTable1.StylePriority.UseFont = false;
            this.xrTable1.StylePriority.UseTextAlignment = false;
            this.xrTable1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableRow1.Cells.AddRange(new XRTableCell[] { 
                this.colOrder, this.colEmployeeCode, this.colEmployeeName, this.colShiftName, this.colD1, this.colD2, this.colD3, this.colD4, this.colD5, this.colD6, this.colD7, this.colD8, this.colD9, this.colD10, this.colD11, this.colD12, 
                this.colD13, this.colD14, this.colD15, this.colD16, this.colD17, this.colD18, this.colD19, this.colD20, this.colD21, this.colD22, this.colD23, this.colD24, this.colD25, this.colD26, this.colD27, this.colD28, 
                this.colD29, this.colD30, this.colD31, this.colRealDay, this.colNightDutyDay, this.colRegulationDay, this.colFurloughDay, this.colCompensationDay, this.colWorkTotal
             });
            this.xrTableRow1.Name = "xrTableRow1";
            this.xrTableRow1.Weight = 1.0;
            this.colOrder.CanGrow = false;
            this.colOrder.Name = "colOrder";
            this.colOrder.Text = "STT";
            this.colOrder.Weight = 0.1678630268667487;
            this.colEmployeeCode.CanGrow = false;
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.Text = "M\x00e3 NV";
            this.colEmployeeCode.Weight = 0.28114484722578592;
            this.colEmployeeName.CanGrow = false;
            this.colEmployeeName.Name = "colEmployeeName";
            this.colEmployeeName.Text = "Họ v\x00e0 t\x00ean";
            this.colEmployeeName.Weight = 0.48525814259459887;
            this.colShiftName.CanGrow = false;
            this.colShiftName.Name = "colShiftName";
            this.colShiftName.Text = "Ca";
            this.colShiftName.Weight = 0.18662218613371157;
            this.colD1.CanGrow = false;
            this.colD1.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colD1.Name = "colD1";
            this.colD1.StylePriority.UseFont = false;
            this.colD1.StylePriority.UseTextAlignment = false;
            this.colD1.Text = "1";
            this.colD1.TextAlignment = TextAlignment.MiddleCenter;
            this.colD1.Weight = 0.10875053923674469;
            this.colD2.CanGrow = false;
            this.colD2.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colD2.Name = "colD2";
            this.colD2.StylePriority.UseFont = false;
            this.colD2.StylePriority.UseTextAlignment = false;
            this.colD2.Text = "2";
            this.colD2.TextAlignment = TextAlignment.MiddleCenter;
            this.colD2.Weight = 0.10875054000353641;
            this.colD3.CanGrow = false;
            this.colD3.Name = "colD3";
            this.colD3.Text = "3";
            this.colD3.Weight = 0.10875054357832478;
            this.colD4.CanGrow = false;
            this.colD4.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colD4.Name = "colD4";
            this.colD4.StylePriority.UseFont = false;
            this.colD4.StylePriority.UseTextAlignment = false;
            this.colD4.Text = "4";
            this.colD4.TextAlignment = TextAlignment.MiddleCenter;
            this.colD4.Weight = 0.10875054061486975;
            this.colD5.CanGrow = false;
            this.colD5.Name = "colD5";
            this.colD5.Text = "5";
            this.colD5.Weight = 0.1087505436602228;
            this.colD6.CanGrow = false;
            this.colD6.Name = "colD6";
            this.colD6.Text = "6";
            this.colD6.Weight = 0.10875054000556711;
            this.colD7.CanGrow = false;
            this.colD7.Name = "colD7";
            this.colD7.Text = "7";
            this.colD7.Weight = 0.10875054471976803;
            this.colD8.CanGrow = false;
            this.colD8.Name = "colD8";
            this.colD8.Text = "8";
            this.colD8.Weight = 0.10875054078079344;
            this.colD9.CanGrow = false;
            this.colD9.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colD9.Name = "colD9";
            this.colD9.StylePriority.UseFont = false;
            this.colD9.StylePriority.UseTextAlignment = false;
            this.colD9.Text = "9";
            this.colD9.TextAlignment = TextAlignment.MiddleCenter;
            this.colD9.Weight = 0.10875054078079366;
            this.colD10.CanGrow = false;
            this.colD10.Name = "colD10";
            this.colD10.Text = "10";
            this.colD10.Weight = 0.10875054460566125;
            this.colD11.CanGrow = false;
            this.colD11.Name = "colD11";
            this.colD11.Text = "11";
            this.colD11.Weight = 0.10875053642567223;
            this.colD12.CanGrow = false;
            this.colD12.Name = "colD12";
            this.colD12.Text = "12";
            this.colD12.Weight = 0.10875053642567145;
            this.colD13.CanGrow = false;
            this.colD13.Name = "colD13";
            this.colD13.Text = "13";
            this.colD13.Weight = 0.10875053600952911;
            this.colD14.CanGrow = false;
            this.colD14.Name = "colD14";
            this.colD14.Text = "14";
            this.colD14.Weight = 0.10875053305812199;
            this.colD15.CanGrow = false;
            this.colD15.Name = "colD15";
            this.colD15.Text = "15";
            this.colD15.Weight = 0.10875054409639351;
            this.colD16.CanGrow = false;
            this.colD16.Name = "colD16";
            this.colD16.Text = "16";
            this.colD16.Weight = 0.10875054409639373;
            this.colD17.CanGrow = false;
            this.colD17.Name = "colD17";
            this.colD17.Text = "17";
            this.colD17.Weight = 0.10875054409639384;
            this.colD18.CanGrow = false;
            this.colD18.Name = "colD18";
            this.colD18.Text = "18";
            this.colD18.Weight = 0.10875054409639373;
            this.colD19.CanGrow = false;
            this.colD19.Name = "colD19";
            this.colD19.Text = "19";
            this.colD19.Weight = 0.10875052523955775;
            this.colD20.CanGrow = false;
            this.colD20.Name = "colD20";
            this.colD20.Text = "20";
            this.colD20.Weight = 0.10875052523955775;
            this.colD21.CanGrow = false;
            this.colD21.Name = "colD21";
            this.colD21.Text = "21";
            this.colD21.Weight = 0.10875052523955775;
            this.colD22.CanGrow = false;
            this.colD22.Name = "colD22";
            this.colD22.Text = "22";
            this.colD22.Weight = 0.10875052523955775;
            this.colD23.CanGrow = false;
            this.colD23.Name = "colD23";
            this.colD23.Text = "23";
            this.colD23.Weight = 0.10875054151048824;
            this.colD24.CanGrow = false;
            this.colD24.Name = "colD24";
            this.colD24.Text = "24";
            this.colD24.Weight = 0.1087505419680902;
            this.colD25.CanGrow = false;
            this.colD25.Name = "colD25";
            this.colD25.Text = "25";
            this.colD25.Weight = 0.10875053938218471;
            this.colD26.CanGrow = false;
            this.colD26.Name = "colD26";
            this.colD26.Text = "26";
            this.colD26.Weight = 0.1087505393821846;
            this.colD27.CanGrow = false;
            this.colD27.Name = "colD27";
            this.colD27.Text = "27";
            this.colD27.Weight = 0.10875053938218482;
            this.colD28.CanGrow = false;
            this.colD28.Name = "colD28";
            this.colD28.Text = "28";
            this.colD28.Weight = 0.10875054409639384;
            this.colD29.CanGrow = false;
            this.colD29.Name = "colD29";
            this.colD29.Text = "29";
            this.colD29.Weight = 0.10875053733514517;
            this.colD30.CanGrow = false;
            this.colD30.Name = "colD30";
            this.colD30.Text = "30";
            this.colD30.Weight = 0.10875053733514495;
            this.colD31.CanGrow = false;
            this.colD31.Name = "colD31";
            this.colD31.Text = "31";
            this.colD31.Weight = 0.10875053733514539;
            this.colRealDay.CanGrow = false;
            this.colRealDay.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colRealDay.Name = "colRealDay";
            this.colRealDay.StylePriority.UseFont = false;
            this.colRealDay.Text = "NC thực tế";
            this.colRealDay.Weight = 0.18289863897830605;
            this.colNightDutyDay.CanGrow = false;
            this.colNightDutyDay.Name = "colNightDutyDay";
            this.colNightDutyDay.Text = "Trực đ\x00eam";
            this.colNightDutyDay.Weight = 0.18662218613371157;
            this.colRegulationDay.CanGrow = false;
            this.colRegulationDay.Name = "colRegulationDay";
            this.colRegulationDay.Text = "Nghỉ chế độ";
            this.colRegulationDay.Weight = 0.19772826254487164;
            this.colFurloughDay.CanGrow = false;
            this.colFurloughDay.Name = "colFurloughDay";
            this.colFurloughDay.Text = "Nghỉ ph\x00e9p năm";
            this.colFurloughDay.Weight = 0.19772825991833415;
            this.colCompensationDay.CanGrow = false;
            this.colCompensationDay.Name = "colCompensationDay";
            this.colCompensationDay.Text = "Nghỉ b\x00f9";
            this.colCompensationDay.Weight = 0.19772825991833418;
            this.colWorkTotal.CanGrow = false;
            this.colWorkTotal.Font = new Font("Times New Roman", 8.25f, FontStyle.Bold);
            this.colWorkTotal.Name = "colWorkTotal";
            this.colWorkTotal.StylePriority.UseFont = false;
            this.colWorkTotal.StylePriority.UseTextAlignment = false;
            this.colWorkTotal.Text = "Tổng c\x00f4ng";
            this.colWorkTotal.TextAlignment = TextAlignment.MiddleCenter;
            this.colWorkTotal.Weight = 0.17545162109346302;
            this.ReportFooter.HeightF = 18f;
            this.ReportFooter.Name = "ReportFooter";
            base.Bands.AddRange(new Band[] { this.Detail, this.TopMargin, this.BottomMargin, this.ReportHeader, this.GroupHeader1, this.ReportFooter });
            base.Font = new Font("Times New Roman", 9.75f);
            base.Landscape = true;
            base.Margins = new Margins(15, 15, 40, 40);
            base.PageHeight = 0x33b;
            base.PageWidth = 0x491;
            base.PaperKind = PaperKind.A4;
            this.TextAlignment = TextAlignment.TopCenter;
            base.Version = "9.3";
            this.BeforePrint += new PrintEventHandler(this.rptListEmployee_BeforePrint);
            this.xrTable1.EndInit();
            this.EndInit();
        }

        private void InitInterface()
        {
            try
            {
                int numberDay = DateTime.DaysInMonth(this.m_Year, this.m_Month);
                this.ShowHideColumn(numberDay);
                for (int i = 1; i <= numberDay; i++)
                {
                    Color white = Color.White;
                    DateTime date = new DateTime(this.m_Year, this.m_Month, i);
                    clsTimeKeeperOption option = new clsTimeKeeperOption();
                    if (date.DayOfWeek.ToString() == "Monday")
                    {
                        white = option.MondayColor;
                    }
                    else if (date.DayOfWeek.ToString() == "Tuesday")
                    {
                        white = option.TuesdayColor;
                    }
                    else if (date.DayOfWeek.ToString() == "Wednesday")
                    {
                        white = option.WednesdayColor;
                    }
                    else if (date.DayOfWeek.ToString() == "Thursday")
                    {
                        white = option.ThursdayColor;
                    }
                    else if (date.DayOfWeek.ToString() == "Friday")
                    {
                        white = option.FridayColor;
                    }
                    else if (date.DayOfWeek.ToString() == "Saturday")
                    {
                        white = option.SaturdayColor;
                    }
                    else if (date.DayOfWeek.ToString() == "Sunday")
                    {
                        white = option.SundayColor;
                    }
                    DIC_HOLIDAY dic_holiday = new DIC_HOLIDAY();
                    if (dic_holiday.Exist(date))
                    {
                        white = option.HolidayColor;
                    }
                    switch (i)
                    {
                        case 1:
                            this.colorD1 = white;
                            break;

                        case 2:
                            this.colorD2 = white;
                            break;

                        case 3:
                            this.colorD3 = white;
                            break;

                        case 4:
                            this.colorD4 = white;
                            break;

                        case 5:
                            this.colorD5 = white;
                            break;

                        case 6:
                            this.colorD6 = white;
                            break;

                        case 7:
                            this.colorD7 = white;
                            break;

                        case 8:
                            this.colorD8 = white;
                            break;

                        case 9:
                            this.colorD9 = white;
                            break;

                        case 10:
                            this.colorD10 = white;
                            break;

                        case 11:
                            this.colorD11 = white;
                            break;

                        case 12:
                            this.colorD12 = white;
                            break;

                        case 13:
                            this.colorD13 = white;
                            break;

                        case 14:
                            this.colorD14 = white;
                            break;

                        case 15:
                            this.colorD15 = white;
                            break;

                        case 0x10:
                            this.colorD16 = white;
                            break;

                        case 0x11:
                            this.colorD17 = white;
                            break;

                        case 0x12:
                            this.colorD18 = white;
                            break;

                        case 0x13:
                            this.colorD19 = white;
                            break;

                        case 20:
                            this.colorD20 = white;
                            break;

                        case 0x15:
                            this.colorD21 = white;
                            break;

                        case 0x16:
                            this.colorD22 = white;
                            break;

                        case 0x17:
                            this.colorD23 = white;
                            break;

                        case 0x18:
                            this.colorD24 = white;
                            break;

                        case 0x19:
                            this.colorD25 = white;
                            break;

                        case 0x1a:
                            this.colorD26 = white;
                            break;

                        case 0x1b:
                            this.colorD27 = white;
                            break;

                        case 0x1c:
                            this.colorD28 = white;
                            break;

                        case 0x1d:
                            this.colorD29 = white;
                            break;

                        case 30:
                            this.colorD30 = white;
                            break;

                        case 0x1f:
                            this.colorD31 = white;
                            break;
                    }
                    this.xrTableRow1.Cells[i + 3].Text = this.DayName(this.m_Year, this.m_Month, i);
                }
            }
            catch
            {
            }
        }

        private void LoadAllData()
        {
            this.InitInterface();
            this.l_TimeKeeperTableList.Get(this.m_Month, this.m_Year);
            DataTable dt = new DataTable();
            dt = this.l_TimeKeeper.GetList(this.m_Level, this.m_Code, this.l_TimeKeeperTableList.TimeKeeperTableListID);
            if (this.m_Level == 0)
            {
                this.txtUnit.Text = "";
            }
            else if (this.m_Level == 1)
            {
                HRM_BRANCH hrm_branch = new HRM_BRANCH();
                hrm_branch.Get(this.m_Code);
                this.txtUnit.Text = "Đơn vị: " + hrm_branch.BranchName;
            }
            else if (this.m_Level == 2)
            {
                HRM_DEPARTMENT hrm_department = new HRM_DEPARTMENT();
                hrm_department.Get(this.m_Code);
                this.txtUnit.Text = "Đơn vị: " + hrm_department.DepartmentName;
            }
            else if (this.m_Level == 3)
            {
                HRM_GROUP hrm_group = new HRM_GROUP();
                hrm_group.Get(this.m_Code);
                this.txtUnit.Text = "Đơn vị: " + hrm_group.GroupName;
            }
            this.Create(dt);
        }

        private void rptListEmployee_BeforePrint(object sender, PrintEventArgs e)
        {
            this.txtTitle.Text = "BẢNG CHẤM C\x00d4NG TH\x00c1NG " + this.m_Month.ToString() + "/" + this.m_Year.ToString();
            this.LoadAllData();
            //if (MyInfo.Get(MyEncryption.Encrypt("ERP01", "123654", true)) == "OK")
            {
                this.txtCompany.Text = "";//MyInfo.Company.ToUpper();
                this.txtAddress.Text = "";//MyInfo.Address;
                this.ptPhoto.Image = null;//MyInfo.Photo;
            }
            DIC_SYMBOL.CreateReport(this, this.ReportFooter, true, false);
            CreateFooterReport.CreateFooter("IsTimekeeper", this.ReportFooter, this);
        }

        private void ShowHideColumn(int NumberDay)
        {
            switch (NumberDay)
            {
                case 0x1c:
                    this.xrTableRow1.Cells.Remove(this.colD31);
                    this.xrTableRow1.Cells.Remove(this.colD30);
                    this.xrTableRow1.Cells.Remove(this.colD29);
                    break;

                case 0x1d:
                    this.xrTableRow1.Cells.Remove(this.colD31);
                    this.xrTableRow1.Cells.Remove(this.colD30);
                    break;

                case 30:
                    this.xrTableRow1.Cells.Remove(this.colD31);
                    break;
            }
        }
    }
}

